#ifndef RENDERWIDGET_H
#define RENDERWIDGET_H

#include <QWidget>
#include<QPainter>
#include<QVector3D>
#include<ray.h>
#include<QDebug>
#include<QScreen>
#include<hitable.h>
#include<float.h>
#include<sphere.h>
#include<hitable_list.h>
#include<camera.h>
#include<lambertian.h>
#include<metal.h>
#include<dielectric.h>
#include<moving_sphere.h>
#include<constant_texture.h>
#include<checker_texture.h>
#include<bvh_node.h>
#include<noise_texture.h>
#include<renderthread.h>
#include<QThread>
#include<QThreadPool>
#include<image_texture.h>
#include<scene.h>
class RenderWidget : public QWidget
{
    Q_OBJECT
public:
    explicit RenderWidget(QWidget *parent = nullptr);
    void paintEvent(QPaintEvent*e);
    void RenderAll();
    void initScene();
private:
    QImage*image;
    int nx,ny;
    scene*sc;
signals:
    void renderImage(renderThread*, scene*sc,QImage *image, int nx, int ny, int x1, int x2, int y1, int y2);

};

#endif // RENDERWIDGET_H
